package com.tyk.bookstore.back.storage.model.query;


import com.tyk.bookstore.back.common.core.model.constant.ValidConstant;
import com.tyk.bookstore.back.storage.model.constant.WarehouseValidConstant;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

/**
 * @author tyk
 * @description 仓库
 */
@Data
public class WarehouseUpdateQuery {

    @Schema(description = "ID")
    @NotNull
    @Min(1)
    private Long id;

    @Schema(description = "名字")
    @NotBlank
    @Size(min = WarehouseValidConstant.NAME_MIN_LENGTH, max = WarehouseValidConstant.NAME_MAX_LENGTH)
    private String name;

    @Schema(description = "所在区域")
    @NotNull
    @Min(1)
    private Long areaCode;

    @Schema(description = "详细地址")
    @NotBlank
    @Size(min = 1, max = 48)
    private String address;

    @Schema(description = "负责人ID")
    @NotNull
    @Min(1)
    private Long userId;

    @Schema(description = "寄件方姓名")
    @NotBlank
    @Size(min = ValidConstant.PEOPLE_NAME_MIN_LENGTH, max = ValidConstant.PEOPLE_NAME_MAX_LENGTH)
    private String senderName;

    @Schema(description = "寄件方地址")
    @NotBlank
    @Size(min = ValidConstant.ADDRESS_MIN_LENGTH, max = ValidConstant.ADDRESS_MAX_LENGTH)
    private String senderAddress;

    @Schema(description = "寄件方电话")
    @Pattern(regexp = ValidConstant.PHONE_REGEXP)
    @NotBlank
    @Size(min = ValidConstant.PHONE_MIN_LENGTH, max = ValidConstant.PHONE_MAX_LENGTH)
    private String senderPhone;
}
